package dailyTopic;

import java.util.Arrays;

/**
 * @author zhangmin
 * @create 2021-07-20 15:26
 */
public class minPairSum1877 {
    public int minPairSum(int[] nums) {
        int n=nums.length;
        Arrays.sort(nums);
        int i=0,j=n-1;
        int res=0;
        while (i<j){
            res=Math.max(res,nums[i]+nums[j]);
            i++;j--;
        }
        return res;
    }
    /*public static void main(String[] args) {
        int[] nums1=new int[]{3,5,4,2,4,6};
        //int[] nums2=new int[]{2,3,5};
        dailyTopic.minPairSum1877 object=new dailyTopic.minPairSum1877();
        System.out.println(object.minPairSum(nums1));
    }*/
}
